<!DOCTYPE html>
<html lang="zh-cn" style="background:#fff">
<head>
	<title>{$meta_title}--{:C('TKE_VERSION')}--Tke团队</title>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<script src="__JS__/jquery.min.js?v={:C('TKE_VERSION')}"></script>
	<link rel="stylesheet" href="__CSS__/bootstrap.min.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__CSS__/bootstrap-responsive.min.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__CSS__/uniform.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__STATIC__/aui-artDialog-9fd667e/css/ui-dialog.css">
	<link rel="stylesheet" href="__CSS__/select2.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__CSS__/matrix-style.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__CSS__/matrix-media.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__CSS__/font-awesome.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__CSS__/bootstrap-datetimepicker.css?v={:C('TKE_VERSION')}" />
	<link rel="stylesheet" href="__CSS__/edit.css?v={:C('TKE_VERSION')}" />	
	<script type="text/javascript">
		/**
		  * @todo	左侧导航高亮
		  */
		function highlight_subnav(url){
			var hight_obj = $('.menu_li').find('a[href="'+url+'"]');
			hight_obj.closest('li').addClass('active');
			hight_obj.parents('.submenu').attr('class','open');
		}
		
	    (function(){
	        var Tke = window.Tke = {
	            "ROOT"   : "__ROOT__", //当前网站地址
	            "APP"    : "__APP__", //当前项目地址
	            "PUBLIC" : "__PUBLIC__", //项目公共目录地址
	            "DEEP"   : "{:C('URL_PATHINFO_DEPR')}", //PATHINFO分割符
	            "MODEL"  : ["{:C('URL_MODEL')}", "{:C('URL_CASE_INSENSITIVE')}", "{:C('URL_HTML_SUFFIX')}"],
	            "VAR"    : ["{:C('VAR_MODULE')}", "{:C('VAR_CONTROLLER')}", "{:C('VAR_ACTION')}"]
	        }
	      
	    })();
    </script>
<style>

</head>
<body>

<style type="text/css">
/*reset 模板内部表单样式 BEGIN*/
.f-hide{display: none;}
.f-show{display: block;}
.tpl_form .row-fluid{margin: 0;}
.tpl_form .row-fluid .control-group{width: 150px;float: left;display:block;margin:0 15px 0 0;}
.tpl_form .row-fluid .select-group{width: 150px;float: left;display: block;margin-right: 15px;}
/*reset 模板内部表单样式 END*/
.row-fluid{margin-top:15px;}
.row-title{float: left;display:block;margin:8px; font-size:14px;padding:0px 10px;border-left:2px solid #ccc;width: 102px;}
.row-title-l2{margin-top:5px;}
.input-text-group{float: left;margin-top:3px;overflow: hidden;}
.input-text-group label{float: left;padding:5px; font-size:14px;}
.input-text-group input{float: left;width:220px;}

.input-radio-group{}
.input-radio-group label{padding:0 15px; margin-top:8px;}
.indent{margin:5px 30px;}
.m-table{margin: 15px 0 0 15px;}
.btn-add-house-info{margin:10px 0 0 15px;}
td{text-align: center;}
.btn-view{position: fixed;top:100px;right:100px;background: rgba(0,0,0,0.6);color: #FFF;display: block;cursor: pointer;display: block;padding: 15px;}
.btn-view:hover{color: #AAA;}
.remarks{outline: none;resize:none;height: 20px;overflow: hidden;}
#content{margin-left: 0px; padding-bottom:0px;background: #FFF;}
</style>
<div id="content">
	<!-- 自由发挥区--开始 -->
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{:U('Index/index')}" title="首页" class="tip-bottom"><i class="icon-home"></i> 首页</a>
			<a href="{:U('ServiceSeat/myRecommend')}">坐席管理</a>
			<a class="current">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<h5>活动报名</h5>
		<form>
			<input name="activity_join_id" type="hidden" value="{$activity_info.activity_join_id}">
			<div style="margin:15px 5px;">
				<!-- 客户类别 -->
				<div class="row-fluid">
					<div class="input-radio-group clearfix">
						<a class="row-title">客户类别: </a>
						<label class="radio">
							<input name="customer_level" type="radio" value="1"  <if condition="$activity_info['customer_level']==1">checked</if>> A
						</label>
						<label class="radio">
							<input name="customer_level" type="radio" value="2" <if condition="$activity_info['customer_level']==2">checked</if>> B
						</label>
						<label class="radio">
							<input name="customer_level" type="radio" value="3" <if condition="$activity_info['customer_level']==3">checked</if>> C
						</label>
					</div>
				</div>
				<!-- /客户类别 -->

				<!-- 报名票别 -->
				<div class="row-fluid">
					<div class="input-radio-group clearfix">
						<a class="row-title">报名票别: </a>
						<if condition="$activity_info['ticket_level']!=='1'">
						<label class="radio">
							<input name="ticket_level" type="radio" value="0" <if condition="$activity_info['ticket_level']==='0'">checked</if>> 普通票
						</label>
						</if>
						<label class="radio">
							<input name="ticket_level" type="radio" value="1" <if condition="$activity_info['ticket_level']==='1'">checked</if>>
							<if condition="$activity_info['ticket_level']==='0'">转化为</if>
							VIP
						</label>
					</div>
				</div>
				<!-- /报名票别 -->

				<div <if condition="$activity_info['ticket_level']==0">style="display:none"</if> id="vip">
					<!-- ======================== 如果VIP票================================ -->
					<h5 style="color:#F30;opacity:0.5;">VIP票信息</h5>
					<input name="express_detail_id" type="hidden" value="{$expressDetail.express_detail_id}"/>
					<div class="row-fluid clearfix">
						<div class="span12">
							<a class="row-title">Vip票收件人:</a>
							<div class="input-text-group clearfix">
								<input type="text" placeholder="Vip票收件人" name="receiving_user" maxlength="6" value="{$expressDetail.receiving_user|htmlspecialchars}">
							</div>
						</div>
					</div>
					<div class="row-fluid clearfix">
						<div class="span12">
							<a class="row-title">收件人手机号码:</a>
							<div class="input-text-group clearfix">
								<input type="tel" placeholder="收件人手机号码" name="receiving_phone_number" maxlength="12" value="{$expressDetail.receiving_phone_number|htmlspecialchars}">
							</div>
						</div>
					</div>

					<div class="row-fluid">
						<div class="span8">
							<a class="row-title">Vip票邮寄地址:</a>
							<div class="input-text-group clearfix">
								<input type="text" placeholder="Vip票邮寄地址" maxlength="100" name="receiving_address" value="{$expressDetail.receiving_address|htmlspecialchars}">
							</div>
						</div>
					</div>

					<div class="row-fluid clearfix">
						<div class="span12">
							<a class="row-title">快递公司: </a>
							<div class="select-group clearfix">
								<select name="express_id">
									<option value="0">请选择快递公司</option>
									<volist name="express" id="vo">
									<option value="{$vo.express_id}" <if condition="$expressDetail['express_id']==$vo['express_id']">selected</if>>{$vo.express_name|htmlspecialchars}</option>
									</volist>
								</select>
							</div>
						</div>
					</div>	
					<div class="row-fluid clearfix">
						<div class="span12">
							<a class="row-title">快递单号: </a>
							<div class="input-text-group clearfix">
								<input type="text" placeholder="请输入快递单号" name="courier_number" maxlength="15" value="{$expressDetail.courier_number|htmlspecialchars}" />
							</div>
						</div>
					</div>

					<!-- 快递状态 -->
					<div class="row-fluid">
						<div class="span4">
							<div class="input-radio-group clearfix">
								<a class="row-title">快递状态</a>
								<label class="radio" style="display:none">
									<input name="mail_status" type="radio" value="0" <if condition="$expressDetail['mail_status']==0">checked="true"</if>> 未发送
								</label>
								<if condition="$expressDetail['mail_status'] lt 2">
								<label class="radio">
									<input name="mail_status" type="radio" value="1" <if condition="$expressDetail['mail_status']==1">checked="true"</if>> 已发送
								</label>
								</if>
								<if condition="$expressDetail['mail_status'] lt 3">
								<label class="radio">
									<input name="mail_status" type="radio" value="2" <if condition="$expressDetail['mail_status']==2">checked="true"</if>> 已签收
								</label>
								</if>
								<if condition="$expressDetail['mail_status'] eq 3">
								<label class="radio">
									<input name="mail_status" type="radio" value="3" <if condition="$expressDetail['mail_status']==3">checked="true"</if>> 已拒收
								</label>
								</if>

							</div>
						</div>

						<div class="span4">
							<div class="input-radio-group clearfix">
								<a class="muted" style="font-size:14px; display:block;margin-top:7px;"><if condition="$expressDetail['mail_time']">快递时间:  {$expressDetail.mail_time|time_format}</if></a>
							</div>
						</div>
					</div>
					<!-- /快递状态 -->
				</div>
				<!-- 班车需求 -->
				<h5>班车需求</h5>
				<div class="row-fluid">
					<div class="span4">
						<a class="row-title">班车: </a>
						<div class="select-group clearfix">
							<select name="bus_point_id">
								<option value="0">请选择班车</option>
								<volist name="activityBusList" id="vo">
								<option value="{$vo.bus_point_id}" <if condition="$bus_demand['bus_point_id']==$vo['bus_point_id']">selected</if>>{$vo.bus_point_id|getBusPointName}</option>
								</volist>
							</select>
						</div>
					</div>
				</div>

				<div class="row-fluid">
					<div class="row-title clearfix" style="width:140px;">发车时间&乘车人数: </div>
					<volist name="activityDepartureTime" id="vo">
					<div class="pull-left" style="margin-left:15px;">
						<div class="checkbox-group">
							<label class="checkbox inline">
								<input type="checkbox"  value="{$vo.departure_time_id}" <if condition="in_array($vo['departure_time_id'],$bus_demand['departure_time_id'])">checked</if> name="departure_time_id[]"> {$vo.departure_time|time_format=###,'Y-m-d'}
							</label>
						</div>
						<div class="input-text-group">
							<input style="width:55px;" maxlength="3" type="text" placeholder="乘坐人数" name="people_num[{$vo.departure_time_id}]" value="<if condition="isset($bus_demand['people_num'][$vo['departure_time_id']])">{$bus_demand['people_num'][$vo['departure_time_id']]}</if>">
						</div>
					</div>
					</volist>
				</div>

				<!-- /班车需求 -->
				<if condition="$activity_info['ticket_level'] !== false">
				<!-- 发送短信 -->
				<h5>发送短信</h5>
				<div class="input-radio-group clearfix">
					<a class="row-title pull-left">短信模板: </a>
					<div class="select-group clearfix pull-left">
						<select name="sms_template_id" id="sms_template_id">
							<option value="0">请选择短信</option>
							<volist name="activitySmsTemplate" id="vo">
							<option value="{$vo.sms_template_id}">{$vo.sms_template_id|getSmsTemplateName}</option>
							</volist>
						</select>
					</div>
					<button style="margin-left:4px;" class="btn btn-info pull-left" id="sms">发送</button>
				</div>
				<!-- /发送短信 -->
				</if>
			</div>
			<if condition="$activity_info['is_false']=='0'">
			<a href="javascript:;" class="btn btn-danger" id="is_false">虚报</a>
			</if>
			<if condition="$activity_info['is_false']==1">
			<a href="javascript:;" class="btn btn-danger">已设置为虚报</a>
			</if>
			<if condition="$activity_info['is_false']!=1">
			<button type="submit" class="btn btn-primary fr" id="submit"><i class="icon-ok"></i> 保存</button>
			</if>
			<div style="height:10px"></div>
		</form>
	</div>

	<!-- 自由发挥区--结束 -->
</div>
<script src="__STATIC__/aui-artDialog-9fd667e/dist/dialog-plus.js"></script>
<script type="text/javascript">
var IS_INIT = 1;
$(function(){
	var top_dialog = top.dialog.get(window);
	$("#sms").click(function(){
		if($("#sms_template_id").val()==0){
			alert('请选择要发送的短信');
			return false;
		}
		$("#sms").attr('disabled',true);
		//锁定提交按钮
		$.post("{:U('ServiceSeat/sendSms',array('activity_id'=>(int)I('get.activity_id'),'customer_id'=>(int)I('get.id')))}", {sms_template_id:$("#sms_template_id").val()}, call_back, "json");
		return false;
		function call_back(data){
			if(data.status == 1){
				alert(data.info);
				i=30;
				var t = setInterval(function(){
					i--;
					if(i<=0){
						$("#sms").html('发送').attr('disabled',false);
						clearInterval(t);
					}else{
						$("#sms").html(i+'秒后可再次发送');
					}
				},1000);
				$("#sms").attr('disabled',true);
			} else {
				alert(data.info);
				$("#sms").attr('disabled',false);
			}
		}
	});
	
	$("#is_false").click(function(){
		if(!confirm("你确定把此报名活动设置为虚报么")){
			return false;
		}
		$("#is_false").attr('disabled',true);
		//锁定提交按钮
		$.post("{:U('ServiceSeat/isFalse',array('activity_join_id'=>$activity_info['activity_join_id']))}", {}, call_back, "json");
		return false;
		function call_back(json){
			if(1 == json.status) {
				var d = top.dialog({
					"title": "提示, 3秒钟后关闭!",
					"content": json.info
				}).showModal();
				setTimeout(function (){
					d.remove().close();
					top_dialog.remove().close();
				}, 2000);


                setTimeout( function(){
                	top.dialog.remove().close();
                }, 3000 ); 
                return false;
			} else {
				var d = top.dialog({
					"title": "提示",
					"content": json.info
				}).showModal();
				$("#is_false").attr('disabled',false);
			}
		}
	});

	$("form").submit(function(){
		//锁定提交按钮
		$("#submit").attr('disabled',true);
		var self = $('form');
		$.post("{:U('ServiceSeat/activityJoin',array('activity_id'=>(int)I('get.activity_id'),'id'=>(int)I('get.id')))}", self.serialize(), call_back, "json");
		return false;
		function call_back(json){
			if(1 == json.status) {
				var d = top.dialog({
					"title": "提示, 3秒钟后关闭!",
					"content": json.info
				}).showModal();
				setTimeout(function (){
					d.remove().close();
					top_dialog.remove().close();
				}, 2000);


                setTimeout( function(){
                	top.dialog.remove().close();
                }, 3000 ); 
                return false;
			} else {
				var d = top.dialog({
					"title": "提示",
					"content": json.info
				}).showModal();
				$("#submit").attr('disabled',false);
			}
		}
	});
	var h = $(document).height();
	$("input[name=ticket_level]").click(function(){
		if($("input[name=ticket_level]:checked").val()==1){
			$("#vip").show(function() {
				top_dialog.height($(document).height());
				top_dialog.reset();
			});
			
		}else{
			$("#vip").hide(function(){
				top_dialog.height(h);
				top_dialog.reset();
			});
			
		}
	});

});
</script>

	<!--end-content-part-->
	
	<script src="__JS__/jquery.ui.custom.js?v={:C('TKE_VERSION')}"></script>
	<script	src="__JS__/bootstrap.min.js?v={:C('TKE_VERSION')}"></script>
	<script	src="__JS__/jquery.uniform.js?v={:C('TKE_VERSION')}"></script>
	<script	src="__JS__/select2.min.js?v={:C('TKE_VERSION')}"></script>
	<script src="__JS__/jquery.dataTables.min.js?v={:C('TKE_VERSION')}"></script>
	<script	src="__JS__/matrix.js?v={:C('TKE_VERSION')}"></script>
	<script src="__JS__/matrix.tables.js?v={:C('TKE_VERSION')}"></script>
	<script src="__JS__/matrix.popover.js?v={:C('TKE_VERSION')}"></script>
	<script src="__JS__/bootstrap-datetimepicker.min.js?v={:C('TKE_VERSION')}"></script> 
    <script type="text/javascript" src="__JS__/tke.js?v={:C('TKE_VERSION')}"></script>
    <!-- public edit css -->
	<script type="text/javascript" src="__JS__/common.js?v={:C('TKE_VERSION')}"></script>
	<!-- 滑动到顶部 -->
    <script type="text/javascript" src="__STATIC__/jquery.scrollUp.min.js"></script>
    <script type="text/javascript">
    $.scrollUp( {
       "scrollText": "Top"
    } );
    </script>
    <!-- /滑动到顶部 -->
	
</body>
</html>